//
// Created by lidongwei on 2023-05-16.
//

#ifndef OLED_DEMO_OLED_H
#define OLED_DEMO_OLED_H

#include "u8g2.h"
#include "u8x8.h"

#define u8         unsigned char  // ?unsigned char ????
#define MAX_LEN    128  //
#define OLED_ADDRESS  0x78 // oled模块从机地址
#define OLED_CMD   0x00  // 写命令
#define OLED_DATA  0x40  // 写数据
#define SCL_Pin GPIO_PIN_6
#define SDA_Pin GPIO_PIN_7
#define IIC_GPIO_Port GPIOB

// 硬件IIC
uint8_t u8x8_byte_hw_i2c(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);

// 软件IIC
uint8_t u8x8_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
void u8g2Init(u8g2_t *u8g2);

#endif //OLED_DEMO_OLED_H
